package com.hzncc.flowable_diboot.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.binding.annotation.BindFieldList;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.Clue;
import com.hzncc.flowable_diboot.entity.Customer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
/**
* 线索 VO定义
* @author MyName
* @version 1.0
* @date 2024-06-14
* Copyright © MyCorp
*/
@Getter @Setter @Accessors(chain = true)
public class ClueListVO extends Clue  {
private static final long serialVersionUID = 1855187590487187396L;
    /**
    * 线索来源 关联字典选项
    */
    @BindDict(
    type = "clueSources",
    field = "source"
    )
    private LabelValue sourceLabel;

    /**
    * 负责人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.uid = id"
     )
    private String uidLabel;

    /**
    * 状态 关联字典选项
    */
    @BindDict(
    type = "clueStatus",
    field = "status"
    )
    private LabelValue statusLabel;

    /**
    * 客户名称 关联信息
    */

    @BindField(
        entity = Customer.class,
        field = "name",
        condition = "this.customerId = id"
     )
    private String customerName;

    @BindFieldList(
        entity = IamUser.class,
        field = "id",
        condition = "this.id = mdl_clue_iam_user.clue and mdl_clue_iam_user.user = id"
    )
    private List<String> starUids;

    /**
    * 关注人 关联信息
    */
    @BindFieldList(
        entity = IamUser.class,
        field = "realname",
        condition = "this.id = mdl_clue_iam_user.clue and mdl_clue_iam_user.user = id"
     )
    private List<String> starUidsLabel;

    /**
    * 客户id 关联信息
    */

    @BindField(
        entity = Customer.class,
        field = "name",
        condition = "this.customer_id = id"
     )
    private String customerIdLabel;

    /**
    * 创建人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.create_by = id"
     )
    private String createByLabel;

    /**
    * 更新人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.update_by = id"
     )
    private String updateByLabel;

    /**
     * 是否关注
     */
    private Integer isStar;
}